home *** CD-ROM | disk | FTP | other *** search
-
- function add_listbox_item(list_box, strItemHtml)
- {
- if (strItemHtml == null || list_box == null || list_box.className != "ListBoxNormal")
- return;
-
- var strId = list_box.id + list_box.children.length;
-
- strInsertString = create_div_begin_tag(strId) + strItemHtml + create_div_end_tag();
- list_box.insertAdjacentHTML("BeforeEnd",strInsertString);
-
- var objCurrentItem = window.document.all[strId];
- set_div_item_events(objCurrentItem);
- return objCurrentItem;
- }
-
- function get_listbox(objCurrent)
- {
- while (objCurrent != null && objCurrent.className != "ListBoxNormal" && objCurrent.className != "ListBoxHover")
- {
- objCurrent = objCurrent.parentElement;
- }
- return objCurrent;
- }
-
- function set_listbox_events(objCurrent)
- {
- if (objCurrent == null)
- {
- for (var nIndex = 0; nIndex < document.body.all.length; nIndex++)
- {
- if (document.body.all[nIndex].className == "ListBoxNormal")
- {
- set_listbox_events(document.body.all[nIndex])
- }
- }
- return;
- }
-
- if (objCurrent.className == "ListBoxNormal")
- {
- objCurrent.onmouseover = listbox_onmouseover;
- objCurrent.onmouseout = listbox_onmouseout;
- }
- }
-
- function listbox_onmouseout()
- {
- var objCurrent = get_listbox(window.event.srcElement);
- objCurrent.idTimeout = setTimeout("window.document.all["+objCurrent.sourceIndex+"].className = \"ListBoxNormal\"",1);
- }
-
- function listbox_onmouseover()
- {
- var objCurrent = get_listbox(window.event.srcElement);
- if (objCurrent.idTimeout != null)
- clearTimeout(objCurrent.idTimeout);
- objCurrent.className = "ListBoxHover";
- }
-